<!DOCTYPE html>
<html lang="zh-cn">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<meta name="renderer" content="webkit">
<title></title>
<link rel="stylesheet" href=" __PUBLIC__/Admin/css/pintuer.css">
<link rel="stylesheet" href=" __PUBLIC__/Admin/css/admin.css">
<script src="__PUBLIC__/Admin/js/jquery.js"></script>
<script src="__PUBLIC__/Admin/js/pintuer.js"></script>
<script src="__PUBLIC__/Admin/js/upload.js"></script>
</head>
<body>
<div class="panel admin-panel">
  <div class="panel-head" id="add"><strong><span class="icon-pencil-square-o"></span>添加文章</strong></div>
  <div class="body-content">
    <form method="post" class="form-x" id="form-x" action="" enctype="multipart/form-data" onsubmit="return submit();">  

      <if condition="$iscid eq 1">
      <div class="form-group">
      <div class="form-group">
        <div class="label">
          <label>文章标题：</label>
        </div>
        <div class="field">
          <input type="text" class="input w50" value="" name="title" data-validate="required:请输入标题" />
          <div class="tips"></div>
        </div>
      </div>
      <div class="form-group">
        <div class="label">
          <label>选择图片：</label>
        </div>
        <div class="field">
          <!-- <div class="input w50" data-validate="required:请选择图片">选择图片</div> -->
          <div class="input w50 upload" id="upload">
            <img id="show_img" src="__PUBLIC__/Admin/images/default.png" alt="">
            <input type="file" id="pic" class="pic" name="pic"/>
          </div>
          <div class="tips"></div>
        </div>
      </div>
      <div class="form-group">
        <div class="label">
          <label></label>
        </div>
        <div class="field">
          <button class="button bg-main icon-check-square-o" id="tijiao" type="submit"> 提交</button>
        </div>
      </div>
    </form>
  </div>
</div>
<script>
  $('#pic').change(function(){
    PUB.upload.checkImg('pic','show_img');
  });
  $('#tijiao').click(function(event) {
    event.preventDefault();
    PUB.upload.upload('form-x',"{:U('Admin/banner/bannerAdd')}",'/admin/banner/bannerlist');
  });
</script>
</body>
</html>

